
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
	<link rel="apple-touch-icon" href="/favicon.ico">
	<title>53AI KM</title>
	<script>	</script>
</head>

<body>
	<style>
		html, body {
			width: 100%;
			height: 100%;
			margin: 0;
			padding: 0;
			box-sizing: border-box;
			overflow: hidden;
		}
	</style>
	<script>
		const user_info = JSON.parse(localStorage.getItem('user_info') || '{}')
		if (user_info.access_token && user_info.eid) window.location.replace(`//${window.location.host}/console/index.html${window.location.search}#/`)
		else {
			const iframe_el = document.createElement('iframe')
			iframe_el.width = '100%'
			iframe_el.height = '100%'
			iframe_el.scrolling = 'no'
			iframe_el.style.border = 'none'
			iframe_el.src = `//${window.location.host}/console/index.html${window.location.search}#/login`
			document.body.appendChild(iframe_el)
			window.addEventListener('message', (event) => {
				if (event.data.action === 'saas-login-success') {
          const params = new URLSearchParams(window.location.search)
          if (params.get('redirect')) {
            window.location.href = params.get('redirect')
          } else {
            window.location.href = `//${window.location.host}/#/`
          }
        }
			}, false)
		}
	</script>
</body>

</html>
